export function getCurrentTime() {
  let date = new Date();
  let y = date.getFullYear(); // 年
  let M = date.getMonth() + 1; // 月
  let d = date.getDate(); // 日
  let h = date.getHours(); // 时
  let m = date.getMinutes(); // 分
  let s = date.getSeconds(); // 秒
  M = M > 9 ? M : "0" + M;
  d = d > 9 ? d : "0" + d;
  h = h > 9 ? h : "0" + h;
  m = m > 9 ? m : "0" + m;
  s = s > 9 ? s : "0" + s;
  return `${y}-${M}-${d} ${h}:${m}:${s}`;
}

// 打招呼问候
// 凌晨好(4-5)
// 早上好(6-11)
// 中午好(12-13)
// 下午好(14-18)
// 晚上好(19-23)
// 深夜啦 (00-3)

export function sayHello() {
  let date = new Date();
  let time = date.getHours();
  if (time > 4 && time < 5) {
    return { title: "凌晨好,天很快要亮啦", msg: require("@/assets/dawn.webp") };
  } else if (time >= 6 && time <= 11) {
    return { title: "早上好,美好的一天到来啦", msg: require("../../assets/morning.webp") };
  } else if (time >= 12 && time <= 14) {
    return { title: "中午好,主人吃完午饭,记得好好休息呀", msg: require("@/assets/noon.webp") };
  } else if (time >= 15 && time <= 18) {
    return { title: "下午好,主人,你坐久了 ,记得多走走", msg: require("@/assets/afternoon.webp") };
  } else if (time >= 19 && time <= 23) {
    return { title: "晚上好啦,稍微放松一下,活动筋骨", msg: require("@/assets/night.webp") };
  } else {
    return { title: "深夜啦,记得好好休息呀", msg: require("@/assets/lateNight.webp") };
  }
}
